package aiproject3.models;

import java.util.HashMap;
/**
 * The Gram class serves as a data structure for the
 * NGramModel. It contains a HashMap
 * containing the probable next characters and its probability.
 * @author Ricardo Madera
 *
 */

public class Gram {
	private int parentCount;
	private HashMap<Character,Integer> childrenMap;
	Gram()
	{
		parentCount = 1;
	}
	public void addCount()
	{
		parentCount++;
	}
	public int getCount()
	{
		return parentCount;
	}
	public void addChild(Character sequence)
	{
		if(childrenMap.containsKey(sequence))
				childrenMap.put(sequence,childrenMap.get(sequence)+1);
		else
			childrenMap.put(sequence, 1);
	}
	public HashMap<Character, Integer> getChildrenMap() {
		return childrenMap;
	}
	public void setChildrenMap(HashMap<Character, Integer> childrenMap) {
		this.childrenMap = childrenMap;
	}
	
	
}
